home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Game Boss - 99 Games
/
Powersource Multimedia - Windows Game Boss 99 Games.iso
/
game1.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-12-25
|
4KB
|
167 lines
unit Game1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, MPlayer,abo;
type
TForm1 = class(TForm)
ListBox1: TListBox;
ListBox2: TListBox;
OpenDialog1: TOpenDialog;
Image1: TImage;
Timer1: TTimer;
ListBox3: TListBox;
MediaPlayer1: TMediaPlayer;
ListBox4: TListBox;
Image2: TImage;
Label1: TLabel;
SpeedButton1: TSpeedButton;
Image3: TImage;
Label2: TLabel;
procedure ListBox1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure SpeedButton1Click(Sender: TObject);
procedure Image3Click(Sender: TObject);
procedure SpeedButton1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
hi=record
na:string;
end;
var
Form1: TForm1;
f:File of hi;
tf :TextFile;
re:hi;
cmd:array[0..255] of char;
st,DIRE:String;
i,star:integer;
p:Boolean;
implementation
{$R *.DFM}
procedure TForm1.ListBox1Click(Sender: TObject);
begin
For i:=0 to 95 do
if listbox1.selected[i] then
begin
p:=false;
mediaplayer1.stop;
chdir(DIRE+listbox4.items[i]);
strpcopy(cmd,DIRE+listbox2.items[i]);
winexec(cmd,sw_showmaximized);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
VAR
sEARCHrEC:tsEARCHrEC;
begin
dire:='d:';
if FindFirst(dire+'\GAME.exe', faAnyFile, SearchRec)<>0 then
While FindFirst(dire+'\GAME.exe', faAnyFile, SearchRec)<>0 do
begin
Findclose(SearchRec);
if inputquery('File error','Please enter new path for GAME.exe',dire)=false
then halt;
End;
{ assignfile(tf,'c:\point.txt');
rewrite(tf);
writeln(tf,intToStr(listbox1.top)+',,'+intToStr(listbox1.left));
writeln(tf,intToStr(image2.top)+',,'+intToStr(image2.left));
writeln(tf,intToStr(label1.top)+',,'+intToStr(label1.left));
writeln(tf,intToStr(label2.top)+',,'+intToStr(label2.left));
writeln(tf,intToStr(image3.top)+',,'+intToStr(image3.left));
writeln(tf,intToStr(speedbutton1.top)+',,'+intToStr(speedbutton1.left));
closefile(tf);
halt;}
if image1.width=800 then
begin
listbox1.top:=192;
listbox1.left:=265;
image2.top:=57;
image2.left:=80;
label1.top:=117;
label1.left:=212;
label2.top:=160;
label2.left:=490;
image3.top:=480;
image3.left:=184;
speedbutton1.top:=152;
speedbutton1.left:=472;
end;
with mediaplayer1 do
begin
filename:=DIRE+'\GAMES\acres.mid';
open;
play;
p:=true;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if p then
with mediaplayer1 do
if position=tracklength[1] then
begin
star:=star+1;
filename:=DIRE+listbox3.items[star];
open;
play;
if star=3 then star:=-1;
end;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
label1.visible:=false;
label2.visible:=false;
if p=false then
begin
mediaplayer1.play;
p:=true;
end;
end;
procedure TForm1.Image2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
label1.visible:=true;
label1.caption:=TimeToStr(Time);
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Image3Click(Sender: TObject);
begin
AboutBox.showmodal;
end;
procedure TForm1.SpeedButton1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
label2.visible:=true;
end;
end.